﻿using IconYuan.Manager.DB;
using IconYuan.Model.Entity.Users;

namespace IconYuan.Manager.Users
{
    public class OauthManager : BaseContext<Oauth>

    {
        public async Task<Oauth> LoginByMobile(string mobile,int oauth_type)
        {
            return await Db.Queryable<Oauth>()
                .Where(x => x.mobile == mobile && x.oauth_type == oauth_type).FirstAsync();
        }
        public async Task<Oauth> LoginOpenId(string open_id, int oauth_type)
        {
            return await Db.Queryable<Oauth>()
                .Where(x => x.open_id == open_id && x.oauth_type == oauth_type).FirstAsync();
        }
    }
}